package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysArticleCategoryMapper;
import com.ruoyi.system.domain.SysArticleCategory;
import com.ruoyi.system.service.ISysArticleCategoryService;

/**
 * 文章分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-02
 */
@Service
public class SysArticleCategoryServiceImpl implements ISysArticleCategoryService 
{
    @Autowired
    private SysArticleCategoryMapper sysArticleCategoryMapper;

    /**
     * 查询文章分类
     * 
     * @param id 文章分类主键
     * @return 文章分类
     */
    @Override
    public SysArticleCategory selectSysArticleCategoryById(Long id)
    {
        return sysArticleCategoryMapper.selectSysArticleCategoryById(id);
    }

    /**
     * 查询文章分类列表
     * 
     * @param sysArticleCategory 文章分类
     * @return 文章分类
     */
    @Override
    public List<SysArticleCategory> selectSysArticleCategoryList(SysArticleCategory sysArticleCategory)
    {
        return sysArticleCategoryMapper.selectSysArticleCategoryList(sysArticleCategory);
    }

    /**
     * 新增文章分类
     * 
     * @param sysArticleCategory 文章分类
     * @return 结果
     */
    @Override
    public int insertSysArticleCategory(SysArticleCategory sysArticleCategory)
    {
        sysArticleCategory.setCreateTime(DateUtils.getNowDate());
        return sysArticleCategoryMapper.insertSysArticleCategory(sysArticleCategory);
    }

    /**
     * 修改文章分类
     * 
     * @param sysArticleCategory 文章分类
     * @return 结果
     */
    @Override
    public int updateSysArticleCategory(SysArticleCategory sysArticleCategory)
    {
        sysArticleCategory.setUpdateTime(DateUtils.getNowDate());
        return sysArticleCategoryMapper.updateSysArticleCategory(sysArticleCategory);
    }

    /**
     * 批量删除文章分类
     * 
     * @param ids 需要删除的文章分类主键
     * @return 结果
     */
    @Override
    public int deleteSysArticleCategoryByIds(Long[] ids)
    {
        return sysArticleCategoryMapper.deleteSysArticleCategoryByIds(ids);
    }

    /**
     * 删除文章分类信息
     * 
     * @param id 文章分类主键
     * @return 结果
     */
    @Override
    public int deleteSysArticleCategoryById(Long id)
    {
        return sysArticleCategoryMapper.deleteSysArticleCategoryById(id);
    }
}
